// NarcissusApp.h: interface for the CNarcissusApp class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_NARCISSUSAPP_H__CFA818D1_C60B_4CC8_86FD_646B5FCB2875__INCLUDED_)
#define AFX_NARCISSUSAPP_H__CFA818D1_C60B_4CC8_86FD_646B5FCB2875__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


//#include "stdafx.h"

#include "YB_DirectX.h"
#include <D3DModel.h>

#include <vector>
using namespace std;

//typedef vector<DWORD>		COLORLIST;

class CD3DFont;
class ToolCamera;
class CEffect;
class CFXDialog;

struct EFFECTVERTEX
{
	FLOAT x, y, z;
	DWORD color;
	float tu, tv;
};

#define D3DFVF_EFFECTVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)

struct GRIDVERTEX
{
	FLOAT x, y, z;
	DWORD color;	
};
struct WALLVERTEX
{
	FLOAT x, y, z;
	float tu, tv;
};

#define D3DFVF_GRIDVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE)
#define D3DFVF_WALLVERTEX (D3DFVF_XYZ|D3DFVF_TEX1)


class CNarcissusApp : public CDirectX
{
public:
	HRESULT UpdateBoneTri(SFrame *pframeCur, D3DXMATRIX &matCur,int &index,void *vertc,int update);
	void RenderBone(SDrawElement *ele);
	void MakeTrails(SDrawElement *ele,int _step);
	void RenderTrails(SDrawElement *ele,int _step);
	int isShadow;
	SDrawElement *ele;
	CNarcissusApp();
	virtual ~CNarcissusApp();

	CD3DFont			*m_pFont;
	ToolCamera				*m_pCamera;
	CEffect				*m_Effect;
	CFXDialog			*m_FXDlg;

	D3DXMATRIX			m_ProjMat;

//	EFFECTVERTEX		m_Grid[160];

	LPDIRECT3DVERTEXBUFFER9		m_GridVB;
	LPDIRECT3DVERTEXBUFFER9		m_WallVB;
	LPDIRECT3DTEXTURE9 walls;

    HRESULT InitDeviceObjects();
    HRESULT RestoreDeviceObjects();
	HRESULT InvalidateDeviceObjects();
    HRESULT DeleteDeviceObjects();
    HRESULT FinalCleanup();
    HRESULT Render();
    HRESULT FrameMove();
	HRESULT ConfirmDevice( D3DCAPS9*, DWORD, D3DFORMAT );
};

extern CNarcissusApp*		g_D3DApp;

#endif // !defined(AFX_NARCISSUSAPP_H__CFA818D1_C60B_4CC8_86FD_646B5FCB2875__INCLUDED_)
